(function (vc) {
    vc.extends({
        data: {
            upShopHouseDetailInfo: {
                orderId: '',
                stateName: '',
                personName: '',
                createTime: '',
                remark: '',
                inoutOrderProducts: []
            }
        },
        _initMethod: function () {
            let orderId = vc.getParam('orderId');
            if (!vc.notNull(orderId)) {
                vc.toast('非法操作');
                vc.getBack();
                return;
            }
            $that.upShopHouseDetailInfo.orderId = vc.getParam('orderId');
            $that._listOrder();
            $that._listInoutOrderProduct();
        },
        _initEvent: function () {
        },
        methods: {
            _listOrder: function () {
                var param = {
                    params: {
                        page: 1,
                        row: 1,
                        orderId: $that.upShopHouseDetailInfo.orderId
                    }
                };
                //发送get请求
                vc.http.apiGet('/inoutOrder/queryInoutOrder',
                    param,
                    function (json, res) {
                        var _storeOrderCart = JSON.parse(json);
                        vc.copyObject(_storeOrderCart.data[0], $that.upShopHouseDetailInfo);
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _listInoutOrderProduct: function () {
                var param = {
                    params: {
                        page: 1,
                        row: 50,
                        orderId: $that.upShopHouseDetailInfo.orderId,
                        shopId: vc.getCurrentCommunity().shopId
                    }
                };
                //发送get请求
                vc.http.apiGet('/inoutOrder.queryInoutOrderProduct',
                    param,
                    function (json, res) {
                        var _storeOrderCartFeeManageInfo = JSON.parse(json);
                        $that.upShopHouseDetailInfo.inoutOrderProducts = _storeOrderCartFeeManageInfo.data;
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _goBack: function () {
                vc.goBack()
            }
        }
    });
})(window.vc);
